4 ECHO ****************************************************************
5 ECHO WARNING: This script will not remove service certificates on a
6 ECHO client machine from a cross machine run of this
9 ECHO If you have run WCF samples that use Certs across machines,
10 ECHO be sure to clear the service certs that have been installed in
11 ECHO the CurrentUser - TrustedPeople store.
12 ECHO To do this, use the following command:
14 ECHO "certmgr.exe -del -r CurrentUser -s TrustedPeople -c -n <Fully Qualified Server Machine Name>"
18 ECHO "certmgr.exe -del -r CurrentUser -s TrustedPeople -c -n server1.contoso.com"
20 DEL service.cer > NUL 2>&1
24 REM cleans up certs from previous runs.
29 echo -------------------------
31 echo -------------------------
32 certmgr.exe -del -r CurrentUser -s TrustedPeople -c -n localhost
34 echo -------------------------
35 echo del service certs
36 echo -------------------------
37 certmgr.exe -del -r LocalMachine -s My -c -n localhost
38 certmgr.exe -put -r LocalMachine -s My -c -n %COMPUTER_NAME% computer.cer
39 IF %ERRORLEVEL% EQU 0 (
42 echo "You have a certificate with a Subject name matching your Machine name."
43 echo "If this certificate is from a cross machine run of WCF samples press any key to delete it."
44 echo "Otherwise press Ctrl + C to abort this script."
46 certmgr.exe -del -r LocalMachine -s My -c -n %COMPUTER_NAME%
50 echo *****************
51 echo Cleanup completed
52 echo *****************
58 REM Puts the Fully Qualified Name of the Computer into a variable named COMPUTER_NAME
59 for /F "delims=" %%i in ('cscript /nologo GetComputerName.vbs') do set COMPUTER_NAME=%%i